	var likeWidget = {
				
				init: function(nodeId, likeText, dislikeText, likeValue, DislikeValue, likeClickCallback, dislikeClickCallback){
					loadFileUtility("../resources/fontello-7b53befb/css/fontello.css","css");
					this.likeText = likeText;
					this.dislikeText = dislikeText;
					this.likeValue = likeValue;
					this.dislikeValue = DislikeValue;

					document.getElementById(nodeId).innerHTML  = this._markup;					
					document.getElementById("_likeWidget").style.width = this._widgetPxWidth;
					document.getElementById("_thumbsUp").innerHTML = this.likeText;
					document.getElementById("_thumbsDown").innerHTML = this.dislikeText;
					document.getElementById("_thumbsUp").style.width = this._likeButtonWidth;
					document.getElementById("_thumbsDown").style.width = this._dislikeButtonWidth;

					var likePercent = this.likeValue / (this.likeValue + this.dislikeValue);
					this._likeBarWidth = Math.round(likePercent * this._widgetPxWidth);
					this._dislikeBarWidth = this._widgetPxWidth - this._likeBarWidth; 

					if(isNaN(this._likeBarWidth) && isNaN(this._dislikeBarWidth)){
						document.getElementById("_likeBar").style.visibility = "hidden"; 
						document.getElementById("_dislikeBar").style.visibility = "hidden";
					}
					else{
						document.getElementById("_likeBar").style.width = this._likeBarWidth; 
						document.getElementById("_dislikeBar").style.width = this._dislikeBarWidth;
						document.getElementById("_likeBar").innerHTML = numberWithCommasUtility(this.likeValue);
						document.getElementById("_dislikeBar").innerHTML = numberWithCommasUtility(this.dislikeValue);
					}
					
					if(this.isDisabled){
						this.onLikeClick = function(){};
						this.onDislikeClick = function(){};
						//document.getElementById("_thumbsUp").className = 'icon-thumbs-up-1-disabled';
						//document.getElementById("_thumbsDown").className = 'icon-thumbs-down-1-disabled';					
						document.getElementById("_thumbsUp").style.cssText = "color: #C7C7C7;	text-align: center; pointer-events: none; width: " + this._likeButtonWidth;
						document.getElementById("_thumbsDown").style.cssText = "color: #C7C7C7; text-align: center; pointer-events: none; width " + this._dislikeButtonWidth;
						
					}else{
						this.onLikeClick = likeClickCallback;
						this.onDislikeClick = dislikeClickCallback;
					}
		        },

		        likeText: "Like",
				
		        dislikeText: "Dislike",
		        
		        likeClickCallback: null,
		        
		        dislikeClickCallback: null,
		        
		        onLikeClick: null,
		        
		        onDislikeClick: null,
		        
		        likeValue: 0,
		        
		        dislikeValue: 0,
		        
		        _likeBarWidth: 0,
		        	
		        _dislikeBarWidth: 0,

		        _widgetPxWidth: 250,

		        _likeButtonWidth: 80,

		        _dislikeButtonWidth: 80,
		        
		        isDisabled: false,
		        
				_markup: '<div id="_likeWidget">' +
							'<div id="_thumbsUp" onclick="likeWidget.onLikeClick()" class="icon-thumbs-up-1"></div>' +
							//'<div id="_thumbsUpValue" class="icon-thumbs-up-1-value"></div>' +
							'<div id="_thumbsDown" onclick="likeWidget.onDislikeClick()" class="icon-thumbs-down-1"></div>' +
							//'<div id="_thumbsDownValue" class="icon-thumbs-down-1-value"></div>' +
							'<div style="clear: both;"></div>' +
							//'<div id="_thumbsUpValue" class="icon-thumbs-up-1-value"></div>' +
							'<div id="_likeBar" style="font-size: 0.8em;background-color: green; padding: 0px; float: left; text-align: center; color: white;"></div>' +
							'<div id="_dislikeBar" style="font-size: 0.8em;background-color: red; padding: 0px; text-align: center; color: white; float: right;"></div>' +
							'<div style="clear: both;"></div>' +
						'</div>'
	};
	
	var loadFileUtility = function(filename, filetype){
		 if (filetype=="js"){ //if filename is a external JavaScript file
		  var fileref=document.createElement('script');
		  fileref.setAttribute("type","text/javascript");
		  fileref.setAttribute("src", filename);
		 }
		 else if (filetype=="css"){ //if filename is an external CSS file
		  var fileref=document.createElement("link");
		  fileref.setAttribute("rel", "stylesheet");
		  fileref.setAttribute("type", "text/css");
		  fileref.setAttribute("href", filename);
		 }
		 if (typeof fileref!="undefined")
		  document.getElementsByTagName("head")[0].appendChild(fileref);
};

function numberWithCommasUtility(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};